package com.ky.pro.java.rpc.demo.provider.config;

import com.ky.pro.java.rpc.core.api.RpcfxResolver;
import com.ky.pro.java.rpc.core.server.RpcfxInvoker;
import com.ky.pro.java.rpc.demo.provider.component.DemoResolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName ComponentConfiguration
 * @Description 配置服务端组件
 * @Date 2022/1/1 14:36
 * @Author kevin
 **/
@Configuration
public class ComponentConfiguration {

    @Bean
    public RpcfxInvoker createInvoker(@Autowired RpcfxResolver resolver) {
        return new RpcfxInvoker(resolver);
    }

    @Bean
    public RpcfxResolver createResolver() {
        return new DemoResolver();
    }

}
